package com.life.view;

import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;

import com.life.constants.Constants;

public class StatusPanel extends JPanel {

	WidgetRegistry widgetRegistry = WidgetRegistry.getInstance();
	JLabel statusStrLabel = new JLabel("Generation: 0");
	JLabel currentRuleLabel = new JLabel("Current Rule: Life");
	JLabel lifeCountLabel = new JLabel("Population: ");
	
	public StatusPanel()
	{
		init();
	}
	
	public void init()
	{
		setLayout(new BorderLayout());
		
		this.add(statusStrLabel,BorderLayout.WEST);
		this.add(currentRuleLabel,BorderLayout.EAST);
		this.add(lifeCountLabel,BorderLayout.NORTH);
		
		widgetRegistry.put(Constants.ITERATION_WIDGET,statusStrLabel);
		widgetRegistry.put(Constants.CURRENT_RULE_WIDGET,currentRuleLabel);
		widgetRegistry.put(Constants.POPULATION_WIDGET,lifeCountLabel);
		
		
	}
}
